import { Token } from 'utils/token.js';

App({
  onLaunch: function (option) {
    //二维码进入
    var id = '';
    if (option.query.scene) {
      var scene = decodeURIComponent(option.query.scene);
      var arr = scene.split("=");
      var id = arr[1];
    }
    wx.getSystemInfo({
      success: res => {
        this.globalData.navHeight = res.statusBarHeight;
      },
    })
    var token = new Token();
    token.verify();
    var cart = wx.getStorageSync('cart');
    if (cart && cart > 0) {
      wx.setTabBarBadge({
        index: 2,   //代表哪个tabbar（从0开始）
        text: cart + ''		//显示的内容
      })
    }
  },
  globalData: {
    userInfo: null,
    navHeight: 0,
  },
  onShow: function () {

  },

})